package com.tools.pojo.license;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;

import java.time.LocalDate;
import java.util.List;

@Getter
@Setter
@JsonPropertyOrder({"subject", "issuedTo", "hardwareId", "expireAt", "features"})
public class License {



    @Schema(description = "软件产品名称")
    private String subject;        // 软件产品名称
    @Schema(description = "许可证授权对象")
    private String issuedTo;       // 许可证授权对象
    @Schema(description = "绑定的硬件指纹")
    private String hardwareId;     // 绑定的硬件指纹

    @Schema(description = "许可证到期时间")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private LocalDate expireAt;    // 许可证到期时间

    @Schema(description = "授权的功能模块列表")
    private List<String> features; // 授权的功能模块列表
    @Schema(description = "数字签名（序列化时排除）")
    private String signature;      // 数字签名（序列化时排除）

    @Override
    public String toString() {
        return "License{" +
                "subject='" + subject + '\'' +
                ", issuedTo='" + issuedTo + '\'' +
                ", hardwareId='" + hardwareId + '\'' +
                ", expireAt=" + expireAt +
                ", features=" + features +
                '}';
    }

}
